/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.inathitunzana.principles.lspviolate.Impl;

/**
 *
 * @author Student
 */
public class Square extends RectangleImpl{

   public Square()
    {}

    @Override
    public void SetWidth(int width)
    {
    	super.SetWidth(width);  // VIOLATION - Derived class extends and Replaces
    	super.SetLength(width); // the functionality of base method in base class.
    }                           // Leads to undesireable effects when used in existing
                                // modules.
    @Override
    public void SetLength(int length)
    {
    	super.SetLength(length); // Since Square class extends RectangleImpl
                                 //(Square is rectangle with identical height and width),
    }                            // which implements the Rectangle class, we replace fuctionality
                                 // of base method because length & width for square
                                 // are identical, but this is a violation of LSP

    @Override
    public int GetArea()
    {
    	return super.GetArea();
    }

}
